﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Logging;

namespace PJ.Framework.Common
{
    /// <summary>
    /// Tracer factory
    /// </summary>
    public static class ActivityTracer
    {
        /// <summary>
        /// Get a trace object
        /// </summary>
        /// <param name="operation">operation name</param>
        /// <returns>IDisposable tracer object</returns>
        public static IDisposable Trace(string operation)
        {
            return InjectionBroker.Resolve<TraceManager>().StartTrace(operation);
        }
        /// <summary>
        /// Get an application start trace object
        /// </summary>
        /// <param name="operation">operation name</param>
        /// <returns>IDisposable tracer object</returns>
        public static IDisposable ApplicationStart()
        {
            return InjectionBroker.Resolve<TraceManager>().StartTrace("ApplicationStart");
        }
    }
}
